package com.ss.android.common.ui.view;

import android.content.Context;
import android.graphics.Color;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;

public class AlphaImageView extends AppCompatImageView {
    private float a;

    public AlphaImageView(Context arg2) {
        this(arg2, null);
    }

    public AlphaImageView(Context arg2, AttributeSet arg3) {
        this(arg2, arg3, 0);
    }

    public AlphaImageView(Context arg2, AttributeSet arg3, int arg4) {
        super(arg2, arg3, arg4);
        this.a = 0.5f;
    }

    public void setPressed(boolean arg4) {
        int v2 = 255;
        super.setPressed(arg4);
        if(arg4) {
            this.setColorFilter(Color.argb(((int)(255f * this.a)), v2, v2, v2));
        }
        else {
            this.clearColorFilter();
        }
    }
}

